import { EChartOption } from 'echarts';

type PieDataType = number[] | number[][] | EChartOption.SeriesPie.DataObject[];

export const getSimpleOption = () => ({
  tooltip: {
    trigger: 'item',
    formatter: '{b} : {c} ({d}%)',
  },

  series: [
    {
      type: 'pie',
      radius: '50%',
      emphasis: {
        itemStyle: {
          shadowBlur: 10,
          shadowOffsetX: 0,
          shadowColor: 'rgba(0, 0, 0, 0.5)',
        },
      },
      label: {
        normal: {
          formatter: '{b|{b}}\n{a|{d}%}\n\n',
          borderWidth: 20,
          borderRadius: 4,
          padding: [0, -20],
          rich: {
            a: {
              fontSize: 10,
              padding: [0, 0, 5, 0],
            },
            b: {
              fontSize: 10,
              margin: [0, 0, 10, 0],
            },
          },
        },
      },
      labelLine: {
        length: 10,
        length2: 5,
      },
      data: [] as PieDataType,
    },
  ] as EChartOption.SeriesPie[],
});
